package com.ruoyi.purchase.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName po_type
 */
@TableName(value ="po_type")
@Data
public class PoType implements Serializable {
    /**
     * 类型编号 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer typeId;

    /**
     * 品牌名称
     */
    @TableField(exist = false)
    private String brandName;

    /**
     * 创建人
     */
    @TableField(exist = false)
    private String createUsername;

    /**
     * 商品类型名称(手机，电脑...)
     */
    private String typeName;

    /**
     * 品牌id 外键
     */
    private Integer poBrandId;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private Integer sysCreateUserId;

    /**
     * 商品状态(0:不可用；1:可用)
     */
    private String status;

    /**
     * 创建时间
     */
    private Date creatTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PoType other = (PoType) that;
        return (this.getTypeId() == null ? other.getTypeId() == null : this.getTypeId().equals(other.getTypeId()))
            && (this.getTypeName() == null ? other.getTypeName() == null : this.getTypeName().equals(other.getTypeName()))
            && (this.getPoBrandId() == null ? other.getPoBrandId() == null : this.getPoBrandId().equals(other.getPoBrandId()))
            && (this.getSysCreateUserId() == null ? other.getSysCreateUserId() == null : this.getSysCreateUserId().equals(other.getSysCreateUserId()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreatTime() == null ? other.getCreatTime() == null : this.getCreatTime().equals(other.getCreatTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTypeId() == null) ? 0 : getTypeId().hashCode());
        result = prime * result + ((getTypeName() == null) ? 0 : getTypeName().hashCode());
        result = prime * result + ((getPoBrandId() == null) ? 0 : getPoBrandId().hashCode());
        result = prime * result + ((getSysCreateUserId() == null) ? 0 : getSysCreateUserId().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreatTime() == null) ? 0 : getCreatTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", typeId=").append(typeId);
        sb.append(", typeName=").append(typeName);
        sb.append(", poBrandId=").append(poBrandId);
        sb.append(", sysCreateUserId=").append(sysCreateUserId);
        sb.append(", status=").append(status);
        sb.append(", creatTime=").append(creatTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}